Class ZipArchive
java.lang.Object
|
+----ZipArchive
- public class ZipArchive
- extends Object
This class is used to manage Zip archive, it can create, add files, delete files
in the archive
- Version:
- 1.0
- Author:
- Frank Moisant - Patrick Titiano
-
table
-
-
zipFileName
-
-
zipFileOpen
-
-
ZipArchive()
- ZipArchive constructor, it initialize the zipArchive
-
addFileToTheArchive(Vector, int)
- Add files into the current zip Archive
-
addFileToTheNewArchive(String, Vector, int)
- Create a new archive with selected files
-
deleteFilesFromArchive(Vector)
- This method delete all selected files in the archive
-
extractFileFromTheArchive(Vector, String)
- Extract file from the current archive
-
getTable()
- This method return the table to display, with all file information
-
isSelected()
- This method return the state of zipArchive
-
setArchiveName(String)
- This method select an archive an call the setTable() method
-
setTable()
- This method extract the information of the archive, and put them in a vector
of rows.
zipFileName
private String zipFileName
table
private Vector table
zipFileOpen
private boolean zipFileOpen
ZipArchive
public ZipArchive()
- ZipArchive constructor, it initialize the zipArchive
setArchiveName
public boolean setArchiveName(String zipFileName)
- This method select an archive an call the setTable() method
- Parameters:
- zipFileName - the path + name of the archive to open
- Returns:
- true if the archive exist and not comrupted
isSelected
public boolean isSelected()
- This method return the state of zipArchive
- Returns:
- true if an archive is opened
getTable
public Vector getTable()
- This method return the table to display, with all file information
- Returns:
- the table to dispay
setTable
private boolean setTable()
- This method extract the information of the archive, and put them in a vector
of rows. ready to display.
- Returns:
- true if the archive is valid
deleteFilesFromArchive
public boolean deleteFilesFromArchive(Vector toDelete)
- This method delete all selected files in the archive
- Parameters:
- toDelete - vector of name of entries
- Returns:
- true if the operation finish successfully
addFileToTheNewArchive
public boolean addFileToTheNewArchive(String name,
Vector filesToAdd,
int positionInPathName)
- Create a new archive with selected files
- Parameters:
- name - the name of the archive to create
- filesToAdd - vector of file names to add in this new archive
- positionInPathName - index of the path should have been truncated, to save relative path
- Returns:
- true if the operation finish successfully
addFileToTheArchive
public boolean addFileToTheArchive(Vector filesToAdd,
int positionInPathName)
- Add files into the current zip Archive
- Parameters:
- filesToAdd - vector of file name
- positionInPathName - index of the path should have been truncated, to save relative path
- Returns:
- true if the operation finish successfully
extractFileFromTheArchive
public boolean extractFileFromTheArchive(Vector toExtract,
String pathToExtract)
- Extract file from the current archive
- Parameters:
- toExtract - vector of entry name to extract
- pathToExtract - the directory where extract the selected entries
- Returns:
- true if the operation finish successfully